<?php
namespace  Android\Model;
use Think\Model;

class LookModel extends Model
{
    //记录列表
    public function  lst(&$user_id){
         //获取浏览的文章
        $info=[];
        $info['article']= $this->alias('lo')->join('article ar on lo.look_id=ar.art_id')->field('time,title,content')->where('lo.user_id='.$user_id." and lo.type=2" )->select();
        //获取浏览的店铺
         $info['shop']=$this->alias('lo')->join('shop sh on lo.look_id=sh.shop_id')->field('shop_logo,time,shop_name,shop_id,intro')->where('lo.user_id='.$user_id." and lo.type=1" )->select();
         $shop=$info['shop'];
        $activity= D('activity');
        foreach ($shop as $k=>$v){
            $shop_id=$v['shop_id'];
            $activity->alias(ac)->join('shop as shop.shop_id=ac.shop_id')->field('act_id,')->where("shop.shop_id=".$shop_id)->select();
        }
        return $info;
    }
}